CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
PROJECT(${APP_NAME})
SET(CMAKE_CXX_STANDARD 17)

# 导入 Qt 模块
find_package(Qt6 COMPONENTS Core Quick Qml REQUIRED)

# 设置Qt相关的变量
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)         # 资源文件处理
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# 添加源文件
file(GLOB_RECURSE SRC_FILES *.cpp)
file(GLOB_RECURSE HEAD_FILES ${HEADPATH}/*.h)
message("HEAD_FILES: ${HEAD_FILES}")

# 添加头文件
include_directories(${HEADPATH})

# 添加可执行文件
set(LIBRARY_OUTPUT_PATH ${EXECPATH})
add_library(${LIB_NAME} SHARED ${SRC_FILES} ${HEAD_FILES})

# 链接 Qt 库
target_link_libraries(${LIB_NAME} PRIVATE
    Qt6::Core
    Qt6::Quick
    Qt6::Qml
)

